# -*- coding: utf-8 -*-
import requests
import json

keyword = input("请输入需要翻译的单词：")
url = "https://fanyi.baidu.com/sug"
data = {"kw": keyword}
response = requests.post(url, data=data)
result = json.loads(response.text)
if result["errno"] == 0:
    print("翻译结果：")
    for item in result["data"]:
        print(item["v"])
else:
    print("翻译失败")
